replace throw with console log