now works as intended