Bug Fix - Slave connection

Wait-loop now works correctly, due to some minor adjustments