query balance function added