implement own window handler