fixed error checking in deploy