API crash fix