Fix frozen string by using map