removed recursion in navigation and script fixed bug