script for file handler