fixed require typo
better exception logging