Added file extention checking