Added missing code for fade-out