friend of friends and fix seg fault