Original post

Because your problem description

this Routine makes a Error, break the main

is so vague, that it is impossible to answer. Please help us helping you by providing a short program that demonstrates the behaviour you observe.