used updated API to get rid of warnings