fixed some constructor bugs