emit with optional context