CLOUDIFY-1565 fix class cast exception