Moved POT test to just before it is drawn to avoid NPE