bug correction/improvements