Attempt to improve closing screen bug.