Fix API level check