Move this code to an earlier place.