use a flag for double enter checks