improved page's redirect,fixed logic by right responsing