added intelligent button focus