protection against seg fault