fix..work in progress
debug is turned off in production..use logs or test on development
fix where the DATABASE settings are acquired
cleanup