Added signal handler for segfaults