trace tick added + some bugs fixed