fixed unit bug and better usage