Stock ID not incrementing fix

Fixed a bug where a new stock ID couldn't be generated.