all logic working except restart when deployed