Fixed the code based on the feedback.