vk middleware implementation