corrected error with variable type