updated console code