added a catch for empty databases
Merge branch 'master' of https://github.com/mleef/AddressBook
fixed logic with empty databases