fixed an error where "process" was used before its definition