fix transfer function