added logging for debugging #619