add second check about map return value