Updated function isTrashed() to meet code guidelines