fixing tests + bug