added background upload

small fixes to js code