fix sub() method