the segmentation fault problem solved. It was caused by the application_out wasn't initialised yet in the link class