fix marketplace apply

working on issue #864.