Modified serialmanager.py to check for a mode of operatin.