Updated

Added error handler