fixed some utils and update_stock