Corrected create procedure