Fixed infinite reloading

Signed off by: Alessandro Palmeira <alessandro.palmeira@gmail.com>