no more globals! and it works with DEBUG profile! \o/