added validation and callbacks