fixed bug assigning from return