fixing tests + improving its stability