Bug resolved in displaying topic details view.

Now it checks if node has any children or not 
If not then if goes for an ajax call where it checks the clicked node is topic node or not
If its a topic node then it goes for displaying detail view.