adding error printing out