fix for array declaration & cleaning