fix bug with clearing vector