Fixed if-else in mainloop