fixing bugs in stocks