check navigation before close