fixed issue where error would raise different exception (cannot convert integer to string)