fixed critical error
fixed compile errors