hard time getting functions to return values from within success function