add balance checking