changed debug to environment variable