added reasons behing segfaults