added some simple file checking