fixed issue with sub() method