fixed arrayaccess implementation