finish user search function