fixed a bug with previous fix