fixing logic of if statement in executethis