Resolving double render error