Fix for null layout problem