added patch file validation