need to use partial function while iterating over map