Fixed classcastexception and removed unecessary accessibility management