changed a logic bug in page creation that resulted in nilclass error