fixing some issues on non-bind statement detection