adding focus logic