fix bug with expect