adding karma function to rootScope