moved log and throw exception to handle exception method