improved bindTransaction code so it throws a clear exception instead of NPE if channel is null