Fixed issue with not correctly dereferncing array ref