wrong if statement fixed