errors in stoch and main file