replaced musicians query with postgres function