add canCommit method