Remove global var and failed sleep attempt