fix file checking