attempt to fix undefined bug