added file validation and locking