added handling for missing files
refactored search behavior on page controller