close behaviour cleaned up