better file check