trying to get rid of double render issue