updated crypto to new api