fixed utility function