Added missing document in front of createElement