file_check method updated with some condition on parameters