Added printf to find the error during the prog execution
Still problem with delete