fix js if no main  block exist