fix behaviour on postgres