Moving curl call before kill command