adding null check around adding route data keys