adding cast to remove compile error in Eclipse