modified to work with regular post requests