moved require_once to beginning of file