Fixed problem with Nil attributes and implemented search functionality