Fixed sleep bug