Changed a bit how closing works