fixed problem when callback functions werent defined