cleaned up old code and added ::text to strings in sql arrays