Update maphandler.py

Fixed error with phase 2 checking that cause cycle when it not supposed to