fixing up bugs