Trying to implement signal. Getting seg fault.