fix crash in render