Added logic to change level