Fixed error when creating invalid posts