bug fixes, in monitor connect function.