check if need to commit