Please show us the mainloop which is only working once, or better yet all the code exactly as you have it.