Fix a bug with sample application resulting in null pointer on back pres...

...s.