Fix some minor issue and implement timer