created middleware for user balance