implement cgi get function