fixed a critical bug