class cast exception (credentials) fix