Fixes bug in search