Resolved some problems and added more logs