add contract logic