added checking to see if stock is left blank before locking/saving it