index out of range bug fixed. reject crossed sturcture