added stub and cleaned up error handling