Fixed bug when use -sleep parameter