fix undefined module on error