Added some indentation and fixed flash error and notice