fixed selection bugs