added warning for search function