Replace $timeout with setTimeout - refs #6