Bug at calculate balance