modified to work with in window message to navigate.