removed unnecessary variable and added and added if condition for commit list