Adding some indention to find bug and fixing bug with closing DIV being added when nothing is started because  is empty