fixed more bugs of previous commits