Fixed bug with resume