beginning x11 handling