add transfer function +  fix events issues