properly parse secret