improving to trigger commit if modification is necessary