Returning pid properly.