fixing onlyif statement