Change getEntity() to getClient() because of deprecation.