Added a ternary operator to help determine console log print out.