fixed render function