Added code to check database functions for adding environments