added exit javascript to index