render has to go in error checking too