make sure to check NULL to avoid AUTOBOX issue