fix bug with register choosing