Fixed if statement and console log response