mainJS modified