Be doubley sure that $achivement_ids is an array by casting it as one