fixed new commit handling and added checkout method