Updated upload method to include background upload