added pid printing, made waiting for attachment time out after 15 seconds