fix a bug in search function. Check if action.search() return None