better singleton implementation, debugging available