fix error in size() method

Signed-off-by: Umair Khan <omerjerk@gmail.com>