Fixed binding bug. Added logging support