error check all calls to calloc