added synchronized lock to ensure only one command is send to mod at a time