fixing some NPE on page load