moved render to scope