app main causing problems changed to example from docs