Added ability to pass in a callback