add $debug variable for convenient