Bug fix for POST or PUT