fixed bugs in setup script