modified server codes