Fixed bug in coordinate assigning wrong location