Fixed minor issue where toc called before tic in control function