adding error handler (lets try this out)