Fix event loop

This will fix #35.