Bug fix: transfering flags