Make sure variable $aMap exists ant it is an array.