fixing double render error