fixed wrong file check