Fix double render bug