fixed a fatal bug