added a simple check for file ext.