replace return with yield in view