fixed bug setting total