fixes click region and adds js events to handle deploy local function better