Added safe slug function