improved q_script_path internal method