client side code for search and alone view