fix for $location on consume page + checking for 'debug' mode