Fix bug with newer cap version