changes to mainjs