Fixed my silly first implementation that was creating a container twice when not needed
Improved error handling