removed mainloop