Bug fixes inside sql class and work on tasks