minor error check fix in console