finaly got cgi working