moved  slow screenshot operation to the end of method