fixed cleanup function in deploy