Fixed an error

Fixed an error in which mapdata[level] was used wrongly