My advice would be to share your code. We do not have something to workwith, to see why the endless loop is occurring.