Search function working. Edited error to redirect :back.