Fixed issue with printing function used