fixed bug with total profit