search option implemented and some bugs fixed