Fix bug when app focsed to close.