Added the possibility of setting flags