When "its breaking" have a look at the Call stack and find the last line of your own code executed before (or while) breaking.