Deleted debug codes,now it should work properly.