bug fixing,added collision