update to mainjs