Master patch

Fixed close problem