fixed attendance generating method in attendance model and tested it