updated for dynamic interaction with main SQL DB