Database communication for classes tab works