Fixed bug with unauthorized due to missing pid