added code so that these work on our live site and database as well as my own local