fixed some document flow issues on modal buttons