update upload hook. Works fine. TODO: delete