Fixed infinite reloading

Signed off by: Alessandro Palmeira <alessandro.palmeira@gmail.com>
Merge pull request #105 from mezuro/fix_infinite_reloading

Fixed infinite reloading