Add exist check before length check