Fixed issue related to sql query returning one object inside of a list