Fix issues with the procedure