fail-proof parser