Adding check for file a valid file extension