fixed bug to handle more to X cases