impled

add red test

WIP

WIP

WIP

WIP
impl error case
bugfix