app working, just need to add error writing