bug fixes inside mapper