added support to capture segfault