Fix js and removed debug code