Fixed a bug with page assignment