Fixed select() function to avoid warnings when the given string is not present