fix javascript so correct status displays during search