fixed some bugs with the mapping