fixed end map errors