fixed a small but critical bug