bug fix of size() method