Added error interception