error if k greater than n