replaced depreceated code