fixed a bug which is related to not enough sleep