Use lists:keyfind/3 instead of lists:keysearch/3