check file extension befor existance for better performance