Trying to work out why exceptions are thrown when moving between views