Added search parameter to getState method