Fix API level compatibility