fix bugs with maps