fix errorhandler bugs
convert to Log::Log