Added logging.
fixed require.