Fix IndexError if not in the database yet