diagnostics and reverted the function changes to tho old way