Correcting improper use of map function.