working subview close funcitonality

@todo add code comments