finish put function