fix posturl helper and cleanup