fixing file handling, removed staging file handler logic