getting file extention correctly