use ERR_peek_last_error() instead of ERR_peek_error()