new way of handling errors, now correctly handles sandbox violation