made error msg more informative