fixed a bug caused by the previous fix