fixed bug, it was returning negative value