fix for bug in xy