fixed error handling in insertplatemap.py