removed duplicated function create_window