If statement works like it should now