bug fix on tmpId passing null as string and some more tabbing