fixed some bugs in setup