Upgraded api for 3.0 compatibility