update checkbalance function