bug fix: here commit should be outside the if test