Fixed issues regarding time keeping. Time only counted when tab is active