added some code for backward compatability