added trim() to generatedSignature to get rid of \r\n