prevent call sleep result in error occur