Fix build() method for custom pages