Fixed tray closing bug