fix for gadget crash