added mouse handling