Refactored method to retrieve current Credential entity. Fixed the query to the credential attributes.