Added in code to fix the searching, adding in more event for buttons