fix flickering bug in minimize button