Conditionals log correct output in console