Added the ability to provide a callback