corrected user variable
added user for gatherkeys. still buggy. TBC