moved code to proper location to prevent missing addresses