move it back inside the if