fixed a few bugs in deployment