removing unneeded !!, since err will either be null or an Error object