add publish script
Fixed errors with generic types