fixed bugs in DB script, querying twitter history script