added API safety