consolelog added to ifstatement