function for getting keys