bugfix - mainloop doesnt stall