Error handling on measurementhandler added.