fixed find_by method