State Monad with IO inside