corrected errors with variable calls