file selection error handling fix