Remove delay and add error handling.