Delete space and add search function