https://gist.github.com/4671861 : using on_idle instead of on_main_loop caused everything to go way too deep