logout implemented
simplify query of search. more effecient