Removing incorrect usage of '$' on array