Fixed bug in index.php that calculated the inactive time incorrectly