Fix bootstrap issue by importing the cgi module lazily