created navigate function