Add more error handling to add method.