changing the place where checks are executed fixing the 0 issue