adding error handler and runtime exception