Corrected error and successfully got output