fixed the mouse listeners so that only the relevant mouse listeners are
taken into account