Even more checking for file format, hopefully it works