Remove commented parts
Corrected error handling and comment