Revised the output format . Included the js error detecion logic and removed unwanted stuff .