Solving errors in map