fixed a potential bug