replacing console.re statement where it belongs