how can $formatter be null here?