fixed a bug that returns boolean not number.