render was being called twice