added check for existing cgi script