Revert "Revert "Bug fixed""

This reverts commit 5765b2027feced574ef75aa3b4f846bea5a32266.