fix "'if' statement improperly formatted" error