removed use of deprecated getClass()