Add Condition on y to solve crash issue.