added done functions for init and shutdown
made sure to check that cb is a function