Create pid before sending it to create function
Extracted checksum logic to own function