add nil protection for NSSet map method