Fixes bug in uploadframe
Some code enhancements