fixed sleep bug