Fixed the procedure