handling typing error