add media support and fixbug