action detectMouse now checks if shape is valid