Fixed error in stock contrler
Various fix