corrected few bugs