This is exactly what I was speaking about: you need to use sys:suspend to lock down your process, do what you need and resume it back. All other ways will lead to parsing message queue