reorder attendance check in server.js