support for $require_once and fixed $type close issues