FIXED eliminated endless spinning of the event loop