stripped out extra code, made pages refresh on device change.