Refactor personnel search, fixed fatal bug