fixing upload path and adding logging