added search and find_by method in model