Add further error handling