Added err arguments

Added err arguments to callback functions