Fixed an issue with trying to use fetchall() twice