Fixed nullPointer Exception in mouse events