fix bug with double render