Fixed the visibility issue
Everything now behaves as it should even though I don't really like the solution...