added check os debug val
Added debug flag checking
Added debug flag to server
Added debug var checking to server