Fixed bug in search function that would delete cards upon adding new ones