updated insertExpense function with balance checking and updating