Program exits on update thread problem