Adding check for type when populationg values for divs.