fixed a bug (division by 0)