improved callback handling in gui