fixed bug in obsolete code