added deprecated detection. seems to work