save subject into database