added SERVER_NAME and fixed tiny bug