Fixed a bit buggy behavior