fixed a small bug that was causing trouble

I know it is trivial but in my project this made my head scratch for some time