Still there are some errors in the checkIf