better handle exception