fixed a bug in database.cpp

would throw vector out of bounds exception