Try exit instead of close event