Fix bug in closing