dynamic layout bug fixes