Fixed if then error