Initial commit to the search function.
Added an error call.