bug fix: to deal with monad properly