added exception handler to update serial function