fixed some bugs and stuff