fix stock checking bug