added debug and error logging functions
added error message when loading a feature fails