post the code you have

at a guess i think you're just getting the coordinates too early