added ko logic