Made functionality of text overlay correctly